import styles from './styles.less';
import SearchForm from './components/SearchForm';
import DataTable from './components/DataTable';
import Detail from "./components/Detail";
import {useState} from 'react';
import Tags from './components/tags/App';
import DataForm from './components/DataForm';
import RechargeForm from './components/RechargeForm';
import Balances from './components/balances/App';

const App = () => {

  const [tablePayload, setTablePayload] = useState({pageNum: 1, pageSize: 15, param: {}});
  const [detail, setDetail] = useState(undefined);
  const [tags, setTags] = useState(undefined);
  const [dataForm, setDataForm] = useState(undefined);
  const [rechargeForm, setRechargeForm] = useState(undefined);
  const [balances, setBalances] = useState(undefined);

  return (
    <div className={styles.myContainer}>
      <Balances data={{balances, setBalances, tablePayload, setTablePayload}}/>
      <DataForm data={{dataForm, setDataForm, tablePayload, setTablePayload}}/>
      <RechargeForm data={{rechargeForm, setRechargeForm, tablePayload, setTablePayload}}/>
      <Detail data={{detail, setDetail}}/>
      <SearchForm data={{tablePayload, setTablePayload}}/>
      <DataTable data={{setBalances, setRechargeForm, setTags, setDataForm, setDetail, tablePayload, setTablePayload}}/>
      <Tags data={{tags, setTags}}/>
    </div>
  );
};

export default App;
